import React from 'react'
import { NavBar, Icon } from "antd-mobile"
import { withRouter } from "react-router-dom"
import "./TitleBack.less"

function TitleBack(props) {
  return (
    <div>
      <NavBar
      className="nav"
        mode="dark"
        icon={<Icon type="left" />}
        onLeftClick={() => props.history.go(-1)}
        rightContent={[
          <Icon key="0" type="search" style={{ marginRight: '16px' }} />
        ]}
      >
        {props.title}
      </NavBar>
    </div>
  )
}
export default withRouter(TitleBack)
